package com.czd.support.service;

import java.util.List;

import org.springframework.stereotype.Service;

import com.czd.base.model.Paginate;
import com.czd.base.service.BaseService;
import com.czd.support.common.Configuration;
import com.czd.support.model.ZcAnswers;

@Service
public class ZcAnswersService extends BaseService<ZcAnswers> {

	public Paginate queryForPaginate(ZcAnswers zcAnswers) {
		zcAnswers.setPageSize(Configuration.getInstance()
				.getDefault_page_size());
		return this.queryForPaginate(sqlId("queryForPaginate"),
				sqlId("questionCount"), zcAnswers);
	}

	public ZcAnswers findById(int id) {
		return this.selectOneById("findById", id);
	}
	
	public   void  addAnswer(ZcAnswers zcAnswers){
		this.insert("addAnswer", zcAnswers);
	}
	
	public   List<ZcAnswers>    findByContent(String answersContent){
		return this.selectList("findByContent", answersContent);
	}
	
	
	/**
	 * 通过临时表删除
	 */
	public void deleteByqId(int  id){
		this.delete("deleteByqId", id);
	}
	
	public ZcAnswers findByqId(int id) {
		return this.selectOneById("findByqId", id);
	}
	
}
   